<template>
    <el-container id="app" class="layout_main">
      <el-header class="layout_head">
      <span class="layout_head_title">管理系统</span>
      <el-menu
        style="float: right;background: transparent;"
        mode="horizontal"
      >
        <el-submenu index="2">
          <template slot="title">欢迎您使用KmFlow</template>
          <el-menu-item @click="visible = true" index="2-1">修改密码</el-menu-item>
          <el-menu-item @click="exit" index="2-2">注销</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-header>
    <el-container>
      <el-aside class="menu_aside" width="200px">
        <MenuComponent />
      </el-aside>
      <el-main class="layout_content">
        <el-container>
          <el-header height="50px">
            <el-breadcrumb class="breadcrumb">
              <el-breadcrumb-item v-for="item in this.$route.matched" :key="item.path" :to="{ path: item.path }">{{ item.meta.title }}</el-breadcrumb-item>
            </el-breadcrumb>
            <el-button class="breadcrumb_back" @click="back" size="small">返回</el-button>
          </el-header>
          <el-main>
            <router-view :key="$route.fullpath" />
          </el-main>
        </el-container>
      </el-main>
    </el-container>
    <el-footer class="copyright">© kmflow demo v_1.0.0</el-footer>
    <el-dialog :close-on-click-modal="false" width="460px" :visible.sync="visible" title="密码管理">
      <el-form ref="form" :model="detail" class="updatePwd_form">
        <el-col :span="22">
          <el-form-item
            :rules="{ required: true, message: '请输入原密码！', trigger: 'blur' }"
            label="原密码"
            label-width="100px"
            prop="original_password"
          >
            <el-input v-model="detail.original_password" auto-complete="off"></el-input>
          </el-form-item>
          <el-form-item
            :rules="[{ required: true, message: '请输入新密码！', trigger: 'blur' },{ min: 6, message: '密码至少为6位！', trigger: 'blur' }]"
            label="新密码"
            label-width="100px"
            prop="password"
          >
            <el-input v-model="detail.password" auto-complete="off"></el-input>
          </el-form-item>
          <el-form-item
            :rules="[{ required: true, message: '请输入确认密码！', trigger: 'blur' },{ min: 6, message: '密码至少为6位！', trigger: 'blur' }]"
            label="确认密码"
            label-width="100px"
            prop="confirm_password"
          >
            <el-input v-model="detail.confirm_password" auto-complete="off"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
      <div slot="footer" class="dialog_foote">
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="updatePwd">确 定</el-button>
      </div>
    </el-dialog>
    </el-container>
</template>

<script>
import Menu from './views/Menu'
export default {
  name: 'App',
  data () {
    return {
      visible: false,
      detail: {}
    }
  },
  components: {
    MenuComponent: Menu
  },
  methods: {
    exit: function () {
      this.$router.push('/')
    },
    cancel: function () {
      this.visible = false
    },
    updatePwd: function () {
    },
    back: function () {
      this.$router.back()
    }
  }
}
</script>
<style lang="less">
@import "./assets/css/base.css";
  .layout_main{
    height: 100%;
  }
  .layout_head{
    border-bottom: 1px solid #E3E3E3;
    //background: #2a94de;
  }
  .layout_head_title{
    line-height: 60px;
    font-size: 32px;
  }
  .layout_head .el-menu{
    height: 59px;
  }
  .layout_head .el-submenu__title{
    border-bottom: 1px solid #E3E3E3 !important;
  }
  .layout_content{
    padding-top: 0px;
  }
  .breadcrumb{
    @height: 50px;
    float: left;
    height: @height;
    line-height: @height;
  }
  .breadcrumb_back{
    float: right;
    position: relative;
    top: 10px;
    left: -11px;
  }
  .copyright{
    @height: 30px;

    text-align: center;
    line-height: @height;
    border-top:1px solid #E3E3E3;
    height: @height !important;
  }
  .menu_aside{
    overflow-x: hidden;
    border-right: 1px solid #e6e6e6;
  }
</style>
